CSE 16: Applied Discrete Mathematics
Instructor: Owen Arden
Winter 2023
Functions are also called mappings or transformations.
Given a function \(f: A \to B\):
We say \(f\) maps \(A\) to \(B\) or \(f\) is a mapping from \(A\) to \(B\).
\(A\) is called the domain of \(f\).
\(B\) is called the codomain of \(f\).
If \(f(a) = b\)
Two functions are equal when they have the same domain, the same codomain, and map each elementR of the domain to the same element of the codomain.
Just like the different notations for defining functions, functions can be specified in different ways.
If \(f: A \to B\) and \(S\) is a subset of \(A\), then
\[f(S) = \{f(s)~|~s \in S\}\]
Suppose \(f: A \to B\).
To show \(f\) is injective:
To show \(f\) is not injective:
To show \(f\) is surjective:
To show \(f\) is not surjective:
Example 1: Let \(f\) be the function from \(\{a,b,c,d\}\) to \(\{1,2,3\}\) defined by \(f(a)=3, f(b)=2, f(c)=1, \text{ and } f(d)=3\). Is \(f\) surjective?
Solution: Yes, \(f\) is surjective since all three elements of the codomain are images of elements in the domain. What if the codomain was \(\{1,2,3,4\}\)?
Example 2: Is the function \(f(x)=x^2\) from the set of integers to the set of integers surjective?
Solution: No, \(f\) is not surjective because (for example) there is no integer x with \(x^2 = -1\).
Non-bijective functions do not have inverses. Why?
\[f: A \to B\]
\[f^{-1}: B \to A\]
\[g: A \to B, f : B \to C\]
\[f \circ g: A \to C\]
The floor of a real number \(x\), written \(\lfloor x \rfloor\), is the largest integer less than or equal to \(x\).
The ceiling of a real number \(x\), written \(\lceil x \rceil\), is the smallest integer greater than or equal to \(x\).
Examples
\(\lceil 3.5 \rceil = 4\)
\(\lfloor 3.5 \rfloor= 3\)
\(\lceil -1.5 \rceil = -1\)
\(\lfloor -1.5 \rfloor= -2\)